<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>数字</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    {% include "public/public.html" %}
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">


        <div class="layui-card-body">
            <div style="padding-bottom: 10px;">
                <button class="layui-btn layui-btn-normal" data-type="batchdel">删除</button>
                <button class="layui-btn layui-btn-normal" data-type="add" id="downData">下载数据</button>
            </div>
            <table class="layui-hide" id="dataTable" lay-filter="currentTableFilter"></table>
            <script type="text/html" id="buttonTpl">

        </script>
            <script type="text/html" id="table-content-doctor">
                <a class="layui-btn layui-btn layui-btn-xs" lay-event="more"><i class="layui-icon layui-icon-more"></i>详细</a>
                <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="setting"><i
                        class="layui-icon layui-icon-set"></i>设置</a>
                <!-- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> -->
                <!-- <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a> -->
            </script>
        </div>
    </div>
</div>

<!-- <script src="/static/layuimini-master/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>-->
<script>

    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;

        //监听搜索
        form.on('submit(LAY-app-contlist-search)', function (data) {
            var field = data.field;

            //执行重载
            table.reload('table-content-specialist', {
                where: field
            });
        });


        //计划表
        table.render({
            elem: '#dataTable'
            , url: "{% url 'digital_date' %}" //模拟接口
            , method: "get"   //method:"post"(注意这里为get后台就是request.GET)
            , response: {
                statusName: 'code' //规定数据状态的字段名称，默认：code
                , statusCode: 0 //规定成功的状态码，默认：0
                , msgName: 'msg' //规定状态信息的字段名称，默认：msg
                , countName: 'count' //规定数据总数的字段名称，默认：count
                , dataName: 'data' //规定数据列表的字段名称，默认：data
            },
            toolbar: true //开启导出工具
            , defaultToolbar: ['filter', 'print', 'exports'] //工具栏
            , cols: [[
                {type: 'checkbox', fixed: 'left', field: 'id'}
                , {field: 'coin', width: 150, title: '代码', sort: true}
                , {field: 'en_name', title: '英文名称', width: 150, sort: true}
                , {field: 'cn_name', title: '中文名称', width: 150, sort: true}
                , {field: 'issue_date', title: '发行时间', width: 150, sort: true}
                , {field: 'issue_price', title: '发行价格', width: 150, sort: true}
                , {field: 'amount', title: '发行总量', width: 150, sort: true}
                , {field: 'supply', title: '流通总量', width: 150, sort: true}
                , {field: 'algo', title: '算法原理', width: 150, sort: true}
                , {field: 'area', title: '发行地区', width: 150, sort: true}
                , {field: 'labels', title: '标签分类', width: 150, sort: true}
                , {field: 'desc', title: '描述', width: 150, sort: true}
            ]]
            , page: true
            , limit: 10
            , limits: [10, 15, 20, 25, 30]
            , text: '对不起，加载出现异常！'
        });


    });


    $("#downData").click(function () {
        $.ajax({
            url: '/chartstest/downDate/',
            type: 'post',

            success: function (res) {
                data = JSON.parse(res);
                // alert(data)
                //console.log(data);
                //showDateLine(tscode);
            },
        })

    });
</script>


</body>
</html>

